<template>
  <div class="set-admin-home-links">
    <w-nav-bar
      title="HomeLinks"/>
    <WCell
      v-for="(v, k) in models"
      :title="v.title"
      @click="$router.push({name: 'SetAdminHomeLinksAdd', query: {id: v._id }})"
      :content="v.link"
      :key="k"/>
    <w-menu-btn
      :add-router="{ name: 'SetAdminHomeLinksAdd' }"
      :dustbin-router="{ name: 'SetAdminHomeLinksDustbin' }"/>
  </div>
</template>

<script>
  import HomeLinksModel from '@/models/web/HomeLinksModel'
  import WCell from '@/components/mobile/cell/00'
  import WMenuBtn from '../../../../com/menu-btn/00'
  export default {
    name: "SetAdminHomeLinks",
    components: {
      WCell,
      WMenuBtn
    },
    data() {
      return {
        /**
         * 模型数组
         */
        models: []
      }
    },
    methods: {
      /**
       * 获取所有数据
       */
      getModels() {
        HomeLinksModel.loadAllModels().then((data) => {
          this.models = data
        }).catch(() => {})
      }
    },
    mounted() {
      this.getModels()
    }
  }
</script>

<style lang="scss" scoped>
  .set-admin-home-links {

  }
</style>
